home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-21 | 898 b | 41 lines | [TEXT/ttxt] |
- --<<<
- -- Kaleida Labs, Inc.
- -- Field Guide to the ScriptX Language
- -- chapter 6, example 8
-
- -- here are some examples of class definitions that override init
-
- class BlahShape (Rect)
- inst vars blahList
- inst methods
- method init self #rest args -> (
- self.blahList := new LinkedList
- apply nextMethod self args
- )
- end
-
- class TextTable (ArrayList)
- inst vars recClass, columns, name
- inst methods
- method init self #rest args \
- #key columns:(10) tabClass: name:("noName") -> (
- apply nextMethod self initialSize:(30) args
- self.recClass := tabClass
- self.name := name
- self.columns := columns
- return self
- )
- end
-
- class ArrowPresenter (TwoDPresenter)
- instance variables strokePaint, direction
- instance methods
- method init self #rest args ->(
- apply nextMethod self \
- boundary:(new Rect x2:15 y2:15) args
- self.strokePaint := blackBrush
- self.direction := @up
- return self
- )
- end
- -->>>